package com.designPatterns.proxy;

/**
 * Created by houjinxin on 16/3/29.
 */
public class StaticProxy4 implements ITarget4, IProxy {

    private ITarget4 target;

    public StaticProxy4(ITarget4 target){
        this.target = target;
    }

    @Override
    public void say(String word) {
        this.before();
        this.target.say(word);
        this.after();
    }

    @Override
    public ITarget4 getProxy() {
        return this;
    }

    public void before(){
        System.out.println("前置增强！");
    }

    public void after(){
        System.out.println("后置增强！");
    }
}
